package com.hzqy.service.broadcast;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.hzqy.persistence.dao.broadcast.BroadcastDao;
import com.hzqy.persistence.dao.cleaner.CleanerDao;
import com.hzqy.service.core.GenericServiceBean;
import com.hzqy.web.vo.CmContentVo;
import com.hzqy.web.vo.broadcast.CmReviewGroupVo;

@Service
public class BroadcastServiceBean  extends GenericServiceBean<CmContentVo,BroadcastDao, Integer>{
protected final Logger LOG = LoggerFactory.getLogger(getClass());
	@Resource
	private BroadcastDao broadcastDao;
	@Override
	public BroadcastDao getEntityDao() {
		return broadcastDao;
	}
	
	public List<CmContentVo> selectContentCountByOrgId(Map<String, Object> map) {
		return broadcastDao.selectContentCountByOrgId(map);
	}
	
	public List<CmContentVo> selectContentListByOrgId(CmContentVo cmContentVo,int pageNo,int pageSize){
		Map<String, Object> map = new HashMap<String,Object>();
		map.put("f_cc_companyid", cmContentVo.getF_cco_orgId());
		map.put("f_cc_obligate4", cmContentVo.getF_cc_obligate4());
		map.put("offset", (pageNo-1)*pageSize);
		map.put("pageSize",pageSize);
		return broadcastDao.selectContentListByOrgId(map);
	}
	
	public int updateContent(CmContentVo cmContentVo) {
		return broadcastDao.updateContent(cmContentVo);
	}
	
	public List<CmContentVo> selectContentCountByOrgIdHY(Map<String, Object> map) {
		return broadcastDao.selectContentCountByOrgIdHY(map);
	}
	
	public List<CmContentVo> selectContentListByOrgIdHY(CmContentVo cmContentVo,int pageNo,int pageSize){
		Map<String, Object> map = new HashMap<String,Object>();
		map.put("f_cc_companyid", cmContentVo.getF_cco_orgId());
		map.put("f_cc_obligate4", cmContentVo.getF_cc_obligate4());
		map.put("offset", (pageNo-1)*pageSize);
		map.put("pageSize",pageSize);
		return broadcastDao.selectContentListByOrgIdHY(map);
	}
	
	public List<CmReviewGroupVo> selectCustomContentCount(CmReviewGroupVo cmReviewGroupVo,int pageNo,int pageSize) {
		Map<String, Object> map = new HashMap<String,Object>();
		map.put("f_crp_id", cmReviewGroupVo.getF_crp_id());
		map.put("offset", (pageNo-1)*pageSize);
		map.put("pageSize",pageSize);
		return broadcastDao.selectCustomContentCount(map);
	}
	
	public List<CmContentVo> selectCustomContentCountList(CmReviewGroupVo cmReviewGroupVo,int pageNo,int pageSize) {
		Map<String, Object> map = new HashMap<String,Object>();
		map.put("f_crp_id", cmReviewGroupVo.getF_crp_id());
		map.put("offset", (pageNo-1)*pageSize);
		map.put("pageSize",pageSize);
		return broadcastDao.selectCustomContentCountList(map);
	}
	
	public CmReviewGroupVo selectReviewGroupById(CmReviewGroupVo cmReviewGroupVo){
		return broadcastDao.selectReviewGroupById(cmReviewGroupVo);
	}
	
	public int selectCustomContentListCount(CmReviewGroupVo cmReviewGroupVo) {
		return broadcastDao.selectCustomContentListCount(cmReviewGroupVo);
	}
}
